package main

import (
	"context"
	"fmt"
	"google.golang.org/grpc"
	"qq_service/delete_same/protobuf/pb"
)

const Address = "127.0.0.1:9004"

func GetDeleteSameQQ(QQ []string, Email, Word string) ([]string, string, string) {

	conn, err := grpc.Dial(Address, grpc.WithInsecure())
	if err != nil {
		fmt.Println(err)
	}
	defer conn.Close()

	c := pb.NewDeleteSameServiceClient(conn)
	req := &pb.QQlistRequest{Qq: QQ, Email: Email, Word: Word}
	res, err := c.DeleteSame(context.Background(), req)
	if err != nil {
		fmt.Println(err)
	}
	return res.Qq, res.Email, res.Word
	//fmt.Println("收到",res.qq)
	//fmt.Println("收到",res.Email)
	//fmt.Println("收到",res.Word)
}
